<?php 
include('./fun.php');
$conn=my_sql($cfg);
$re=adm_login();
if($re['err']=='no_login'){die('<script>no_login()</script>');}
if($re['err']!='ok'){die('<hh><b>'.$re['err'].'</b></hh>');}
$adm=$re['adm'];
if($adm['power']!='adm'){err('抱歉，您没有查看的权限');}

$c=g('c');
$id=g('id');
if($id){
$sql='select * from '.$cfg['e'].'print where id="'.$id.'"';
$l=db1($sql);

}

$s=['订单提交','退款'];

?>
<temp_list>
<l><text>名称</text>
<input placeholder="打印机名称" value="<?php echo $l['name']?>" c="name" need="1">
</l>
<l><text>所属商户</text>
<input placeholder="所属商户" value="<?php echo $l['shop_id']?>" c="shop_id" need="1">
</l>
    <l><text>终端号</text>
        <input placeholder="打印机终端号" value="<?php echo $l['appid']?>" c="appid" need="1">
    </l>
    <l><text>密匙</text>
        <input placeholder="打印机密匙" value="<?php echo $l['appkey']?>" c="appkey" need="1">
    </l>

<l><a class="submit_bt" onclick="submit($(this))">提交</a></l>
</temp_list>


<script>
function select_s(o){
var val=o.html();
$('#s input').val(val);
$('#s a').removeClass('select');
o.addClass('select');
}

function submit(o){
var re=form_data($('temp_list input'));
if(re.can!=0){return;}
var data=re.data;
console.log("这里")
console.log(data);
post('print_save', {data},'<?php echo $l['id']?>',function(res){
    msg('修改成功');
    main_load();
    right_close();
});
}


</script>